import { defineComponent, ref } from "vue";
import { useRouter } from "vue-router";

export default defineComponent({
  name: 'Demo',
  render() {
    console.log('>>>> demo:', this.state)
    return (
      <div>
        <p>render demo page {this.state}</p>
        <p><button onClick={this.jumpToHome}>jump to home</button></p>
      </div>
    )
  },
  setup() {
    const state = ref(1)
    const router = useRouter()

    function jumpToHome() {
      router.push('/')
    }
    return {
      state,
      jumpToHome,
    }
    // return () => (
    //   <div>
    //     <p>demo-page</p>
    //   </div>
    // )
  }
})
